1. Field of the Invention
The present invention relates to image processing, and, in particular, to a method and apparatus for adaptive thresholding of multi-bit pixel images.
2. Statement of Related Art
Image processing often involves the thresholding of multi-bit (i.e., gray-scale) input pixel images into one-bit (i.e., binary) output pixel images. In certain applications, the thresholding decision for each pixel in the input image may be based on a single constant threshold value. However, using a fixed threshold value will not yield adequate results in all applications.
Referring to FIG. 1, there is shown a graphical representation of one row of an 8-bit pixel image for which a fixed threshold value will not yield adequate results. FIG. 1 may represent a line perpendicularly bisecting a barcode symbol having dark bars and bright spaces. The image of FIG. 1 may have been generated in an environment in which the illumination was not uniform over the imaged area. Alternatively, the image may have been generated using a camera with non-uniform response over the camera sensing elements.
As a result, the image of FIG. 1 exhibits variations in both offset and dynamic range across the image. The variation in offset is so great that pixels corresponding to "bright" symbol spaces at the edge of the image have values less than pixels corresponding to "dark" symbol bars at the center of the image. Using a fixed threshold therefore will not accurately distinguish all bars and spaces in the image.
To solve this problem, methods and systems for thresholding have been developed that employ adaptive thresholding. In adaptive thresholding, the threshold value varies over the image according to functions based on the actual image pixels. However, conventional adaptive thresholding does not adequately threshold images in all applications. For example, conventional adaptive thresholding is unable to threshold, in real time and in a cost-efficient manner, gray-scale images generated by high-speed, monochrome, line-scan video cameras.